home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
tex
/
td187src.lzh
/
MAGICBIO.I
< prev
next >
Wrap
Text File
|
1991-06-10
|
4KB
|
208 lines
(*######################################################################
MAGIC Modula's All purpose GEM Interface Cadre
¯ ¯ ¯ ¯ ¯
########################################################################
BIOS Basic Input Output System Interface for Modula-2
Implementation für Megamax-Modula-2
########################################################################
V2.00 16.10.90 Peter Hellinger Anpassung an neues MagicSys
V1.04 05.08.90 Peter Hellinger
V1.00 (C) by Peter Hellinger
######################################################################*)
IMPLEMENTATION MODULE MagicBIOS;
FROM SYSTEM IMPORT WORD, ADDRESS, ADR, ASSEMBLER;
FROM MagicSys IMPORT Nil, Null,
Bit0, Bit1, Bit2, Bit3, Bit4, Bit5, Bit6, Bit7,
Bit8, Bit9, Bit10, Bit11, Bit12, Bit13, Bit14, Bit15,
Byte, ByteSet,
sWORD, sINTEGER, sCARDINAL, sBITSET,
lWORD, lINTEGER, lCARDINAL, lBITSET;
IMPORT MagicSys;
VAR lc: lCARDINAL;
li: lINTEGER;
lb: lBITSET;
i: sINTEGER;
c: sCARDINAL;
b: sBITSET;
a: ADDRESS;
x: sCARDINAL;
PROCEDURE Getmpb (VAR mpb: ADDRESS);
BEGIN
ASSEMBLER
MOVE.L mpb(A6), -(SP)
MOVE #0, -(SP)
TRAP #13
ADDQ.L #6, SP
END;
END Getmpb;
PROCEDURE Bconstat (device: sINTEGER): BOOLEAN;
BEGIN
ASSEMBLER
MOVE.W device(A6), -(SP)
MOVE #1, -(SP)
TRAP #13
ADDQ.L #4, SP
MOVE.W D0, c
END;
RETURN c # 0;
END Bconstat;
PROCEDURE Bconin (device: sINTEGER): lCARDINAL;
BEGIN
(** Original, fehlerhaft, korrigiert JP-91
ASSEMBLER
MOVE.W device(A6), -(SP)
MOVE #2, -(SP)
TRAP #13
ADDQ.L #4, SP
MOVE.W D0, lc
END;
**)
ASSEMBLER
MOVE.W device(A6), -(SP)
MOVE #2, -(SP)
TRAP #13
ADDQ.L #4, SP
MOVE.L D0, lc
END;
RETURN lc;
END Bconin;
PROCEDURE Bconout (device: sINTEGER; c: CHAR);
BEGIN
x:= ORD (c);
ASSEMBLER
MOVE.W x, -(SP)
MOVE.W device(A6), -(SP)
MOVE #3, -(SP)
TRAP #13
ADDQ.L #6, SP
END;
END Bconout;
PROCEDURE Rwabs (rw: sINTEGER; buf: ADDRESS; count, recno, dev: sINTEGER): lINTEGER;
BEGIN
ASSEMBLER
MOVE.W dev(A6), -(SP)
MOVE.W recno(A6), -(SP)
MOVE.W count(A6), -(SP)
MOVE.L buf(A6), -(SP)
MOVE.W rw(A6), -(SP)
MOVE #4, -(SP)
TRAP #13
LEA $E(SP), SP
MOVE.L D0, li
END;
RETURN li;
END Rwabs;
PROCEDURE Setexc (vecnum: sINTEGER; vec: ADDRESS): ADDRESS;
BEGIN
ASSEMBLER
MOVE vec(A6), -(SP)
MOVE.W vecnum(A6), -(SP);
MOVE #5, -(SP)
TRAP #13
ADDQ.L #8, SP
MOVE.L D0, a
END;
RETURN a;
END Setexc;
PROCEDURE Tickcal(): lCARDINAL;
BEGIN
ASSEMBLER
MOVE #6, -(SP)
TRAP #13
ADDQ.L #2, SP
MOVE.L D0, lc
END;
RETURN lc;
END Tickcal;
PROCEDURE Getbpb (drive: sINTEGER): ADDRESS;
BEGIN
ASSEMBLER
MOVE.W drive(A6), -(SP)
MOVE #7, -(SP)
TRAP #13
ADDQ.L #4, SP
MOVE.L D0, a
END;
RETURN a;
END Getbpb;
PROCEDURE Bcostat (device: sINTEGER): BOOLEAN;
BEGIN
ASSEMBLER
MOVE.W device(A6), -(SP)
MOVE #8, -(SP)
TRAP #13
ADDQ.L #4, SP
MOVE.W D0, c
END;
RETURN c # 0;
END Bcostat;
PROCEDURE Mediach (dev: sINTEGER): sINTEGER;
BEGIN
ASSEMBLER
MOVE.W dev(A6), -(SP)
MOVE #9, -(SP)
TRAP #13
ADDQ.L #4, SP
MOVE.W D0, i
END;
RETURN i;
END Mediach;
PROCEDURE Drvmap (): lBITSET;
BEGIN
ASSEMBLER
MOVE #10, -(SP)
TRAP #13
ADDQ.L #2, SP
MOVE.L D0, lb
END;
RETURN lb;
END Drvmap;
PROCEDURE Kbshift (keys: sBITSET): sBITSET;
BEGIN
ASSEMBLER
MOVE.W keys(A6), -(SP);
MOVE #11, -(SP)
TRAP #13
ADDQ.L #4, SP
MOVE.W D0, b
END;
RETURN b;
END Kbshift;
END MagicBIOS.